Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

misc: Move browser dropdown within AUT URL bar #31216

Merged
merged 30 commits into from
Mar 11, 2025

Conversation

jennifer-shehane
Copy link
Member

@jennifer-shehane jennifer-shehane commented Mar 4, 2025

Additional details

  • The browser dropdown above the AUT now displays to the left of the URL area, with just a preview of the browser icon.
  • The currently selected browser now displays at the top of the list so one can easily see the selected version.
  • Long browser names now left align properly.

Steps to test

  • Run yarn cypress:open in the packages/app directory
  • Test in open mode and run mode (headed)
  • Test in e2e and CT testing types
  • Ensure browser dropdown is disabled while tests are running
  • Check percy screenshots - I reviewed them, but left them unapproved

How has the user experience changed?

Before

Screenshot 2025-03-04 at 3 25 36 PM
Screenshot 2025-03-04 at 3 25 44 PM

After

Screenshot 2025-03-04 at 2 53 26 PM
Screenshot 2025-03-04 at 2 53 08 PM

Automation Missing error did not change much

Screenshot 2025-03-10 at 12 53 27 PM

PR Tasks

@jennifer-shehane jennifer-shehane self-assigned this Mar 4, 2025
Copy link

cypress bot commented Mar 4, 2025

cypress    Run #60833

Run Properties:  status check passed Passed #60833  •  git commit 6a49184966: Merge branch 'browser-dropdown-ux-update' of https://github.com/cypress-io/cypre...
Project cypress
Branch Review browser-dropdown-ux-update
Run status status check passed Passed #60833
Run duration 18m 18s
Commit git commit 6a49184966: Merge branch 'browser-dropdown-ux-update' of https://github.com/cypress-io/cypre...
Committer Jennifer Shehane
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 10
Tests that did not run due to a developer annotating a test with .skip  Pending 1232
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 32102
View all changes introduced in this branch ↗︎
UI Coverage  46.57%
  Untested elements 182  
  Tested elements 163  
Accessibility  92.57%
  Failed rules  3 critical   8 serious   2 moderate   2 minor
  Failed elements 885  

@@ -151,7 +151,7 @@ describe('Cypress In Cypress E2E', { viewportWidth: 1500, defaultCommandTimeout:
})

it('shows a compilation error with a malformed spec', { viewportHeight: 596, viewportWidth: 1000 }, () => {
const expectedAutHeight = 456 // based on explicitly setting viewport in this test to 596
const expectedAutHeight = 500 // based on explicitly setting viewport in this test to 596
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has legitimately changed, previously the browser dropdown at this width was lessening the AUT height.
Screenshot 2025-03-05 at 12 10 26 PM

Screenshot 2025-03-05 at 12 10 37 PM

@@ -128,7 +128,7 @@ export const longBrowsersList = [
majorVersion: '69',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really necessary changes, but these mocks seem more realisitic

@@ -1,3 +1,4 @@
<!-- Be careful with changing styles of the panels, it can impact our screenshot tests -->
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lesson learned.......

@jennifer-shehane jennifer-shehane removed the request for review from cacieprins March 10, 2025 16:14
@jennifer-shehane jennifer-shehane merged commit 830dacb into develop Mar 11, 2025
90 of 93 checks passed
@jennifer-shehane jennifer-shehane deleted the browser-dropdown-ux-update branch March 11, 2025 13:44
Copy link
Contributor

@AtofStryker AtofStryker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See I'm a little late but had a few comments

@@ -61,14 +64,15 @@ import { Popover, PopoverButton, PopoverPanel } from '@headlessui/vue'
const props = withDefaults(defineProps<{
variant?: 'panel'
align?: 'left' | 'right'

minimal?: boolean
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add a comment or two describing the new minimal option here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I can see one allows for a visual dropdown with a chevron vs the browser icon being the dropdown?

const inputZIndex = computed(() => {
// input needs to be above the Studio prompt overlay
// but other times it needs to be below other resizable panels
return studioStore.needsUrl ? 51 : 5
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the studio prompt overlay have a z-index of 50 or something near that? Is there a better way to determine the z-index value here over static values?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yah, the overlay has a 50 zindex. It is a good point, this code was so brittle with the zindex changes. I suffered a lot.

const alphaSortedBrowser = (props.gql.browsers ?? []).slice().sort((a, b) => a.displayName > b.displayName ? 1 : -1)

// move the selected browser to the top to easily see selected browser version at the top when opening the dropdown
alphaSortedBrowser.some((browser, i) => browser.isSelected && alphaSortedBrowser.unshift(alphaSortedBrowser.splice(i, 1)[0]))
Copy link
Contributor

@AtofStryker AtofStryker Mar 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might make this easier to read/debug with something like this to see whats selected? Not as optimized but we are dealing with fairly small arrays. More of a nit if anything

Suggested change
alphaSortedBrowser.some((browser, i) => browser.isSelected && alphaSortedBrowser.unshift(alphaSortedBrowser.splice(i, 1)[0]))
const [selectedBrowser] = _.remove(alphaSortedBrowser, (browser) => browser.isSelected)
alphaSortedBrowser.unshift(selectedBrowser)

@@ -123,7 +121,12 @@ const props = withDefaults(defineProps <{
})

const browsers = computed(() => {
return (props.gql.browsers ?? []).slice().sort((a, b) => a.displayName > b.displayName ? 1 : -1)
const alphaSortedBrowser = (props.gql.browsers ?? []).slice().sort((a, b) => a.displayName > b.displayName ? 1 : -1)
Copy link
Contributor

@AtofStryker AtofStryker Mar 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not: maybe a sortBy makes this more readable?

Suggested change
const alphaSortedBrowser = (props.gql.browsers ?? []).slice().sort((a, b) => a.displayName > b.displayName ? 1 : -1)
const alphaSortedBrowser = _.sortBy(props.gql.browsers ?? [], 'displayName')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants